package com.pai4j.message.websocket;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

import jakarta.annotation.PostConstruct;

/**
 * WebSocket配置类
 * 
 * 启用条件：pai4j.message.websocket.enabled=true（默认启用）
 *
 * @author PAI4J Team
 * @date 2025-11-01
 */
@Slf4j
@Configuration
@EnableScheduling
@EnableConfigurationProperties(WebSocketProperties.class)
@ConditionalOnProperty(prefix = "pai4j.message.websocket", name = "enabled", havingValue = "true", matchIfMissing = true)
public class WebSocketConfiguration {

    @PostConstruct
    public void init() {
        log.info("========================================");
        log.info("PAI4J Message SDK - WebSocket模块已启用");
        log.info("支持功能：");
        log.info("  - WebSocket实时消息推送");
        log.info("  - 多端推送（PC、Mobile等）");
        log.info("  - Session健康监控");
        log.info("  - 自动降级机制");
        log.info("========================================");
    }
}

